As an electric compressor of this kind, there has hitherto been used an electric compressor which is provided with a compression section for compressing a cooling medium sucked in a housing, a motor for driving the compression section, a motor driving circuit for driving a motor which has a plurality of heat generating parts, and a partition wall which is provided so as to partition the cooling medium suction chamber provided on the cooling medium inflow side in the housing and a driving circuit housing chamber in which the motor driving circuit is housed and permits heat exchange between the cooling medium in the cooling medium suction chamber and the motor driving circuit in the driving circuit housing chamber (refer to Patent Literature 1, for example).
In the above-described electric compressor, it is ensured that the motor driving circuit is cooled by a cooling medium via the partition in order to prevent troubles and breakdowns of the motor driving circuit due to the heat generated by the heat generating parts. Also, it is ensured that troubles and breakdowns of the motor driving circuit are prevented by controlling the number of revolutions of the motor on the basis of temperatures detected by a temperature sensor, such as a thermistor, which is provided to detect the temperature of the motor driving circuit.